package com.gyx.metaldesigndemo;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import com.gyx.metaldesigndemo.coordinator.AppbarlayoutActivity;
import com.gyx.metaldesigndemo.coordinator.BehaviorTopTestActivity;
import com.gyx.metaldesigndemo.coordinator.CollapsingToolBarLayoutActivity;
import com.gyx.metaldesigndemo.coordinator.ToolBarActivity;
import com.gyx.metaldesigndemo.nav.NavActivity;
import com.gyx.metaldesigndemo.recycle.RecycleViewActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    TextView tv1,tv2,tv3,tv4,tv5,tv6;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        tv1= (TextView) findViewById(R.id.tv1);
        tv2= (TextView) findViewById(R.id.tv2);
        tv3= (TextView) findViewById(R.id.tv3);
        tv4= (TextView) findViewById(R.id.tv4);
        tv5= (TextView) findViewById(R.id.tv5);
        tv6= (TextView) findViewById(R.id.tv6);


        tv1.setOnClickListener(this);
        tv2.setOnClickListener(this);
        tv3.setOnClickListener(this);
        tv4.setOnClickListener(this);
        tv5.setOnClickListener(this);
        tv6.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.tv1:
                startAct(AppbarlayoutActivity.class);
                break;
            case R.id.tv2:
                startAct(ToolBarActivity.class);
                break;
            case R.id.tv3:
                startAct(CollapsingToolBarLayoutActivity.class);
                break;
            case R.id.tv4:
                startAct(BehaviorTopTestActivity.class);
                break;
            case R.id.tv5:
                startAct(RecycleViewActivity.class);
                break;
            case R.id.tv6:
                startAct(NavActivity.class);
                break;
        }

    }

    private void startAct(Class clazz){
        Intent intent=new Intent(this,clazz);
        startActivity(intent);
    }
}
